/*
 * Copyright 2010 Michael Nitsche
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

package de.mnit.basis.fehler;

import de.mnit.basis.daten.konstant.RECHT;
import de.mnit.basis.fehler.programm.F_Sicherheit;
import de.mnit.basis.fehler.system.F_Sys_Sicherheit;

/**
 * @author Michael Nitsche
 */
public class H_Sicherheit {

	public static F_Sicherheit debugFehler(Object... o) {
		return F_Sicherheit.neu(Fehler.text_debug, o);
	}

	public static F_Sicherheit da_Verboten(Object... o) {
		return F_Sicherheit.neu("Zugriff verweigert",o);
	}

	public static F_Sys_Sicherheit da_Schluessel_Ungueltig(Object... o) throws F_Sys_Sicherheit {
		return F_Sys_Sicherheit.neu("Schlüssel ist ungültig", o);
	}

	public static F_Sicherheit da_Geschuetzt() {
		return F_Sicherheit.neu("Objekt ist geschützt!");
	}

	public static void wenn_Leseschutz(RECHT recht) {
		if(!recht.lesen)
			F_Sicherheit.neu("Feld ist Lesegeschützt", recht);
	}
}

